package com.ycl.job.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.job.service.impl.BaseImportTaskServiceImpl;
import com.zbf.common.entity.ResponseResult;
import com.zbf.common.entity.my.BaseExportTaskHeader;
import com.zbf.common.entity.my.BaseImportTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 袁成龙
 * @since 2020-10-25
 */
@RestController
@RequestMapping("/baseImportTask")
public class BaseImportTaskController {

    @Autowired
    private BaseImportTaskServiceImpl baseImportTaskService;

    ResponseResult responseResult = new ResponseResult();

    @RequestMapping("/listimport")
    public ResponseResult listpage(BaseImportTask baseImportTask, Page page){
        QueryWrapper<BaseImportTask> queryWrapper = new QueryWrapper();
        if (baseImportTask.getImname()!=null){
            queryWrapper.like("imname",baseImportTask.getImname());
        }
        if(baseImportTask.getCreateTime()!=null){
            queryWrapper.gt("createTime",baseImportTask.getCreateTime());
        }
        if(baseImportTask.getStatus()!=null){
            queryWrapper.eq("status",baseImportTask.getStatus());
        }
        IPage page1 = baseImportTaskService.page(page, queryWrapper);
        responseResult.setResult(page1);

        return responseResult;
    }

}

